﻿/*  mfe-proj - Mystery Fiction Encyclopedia

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.*/
 
/*  Written by leyang <mysterybbs@gmail.com>  */

using System;
using System.Windows.Forms;
using System.Data.SQLite;
using System.Data;
using System.Collections.Specialized;
using System.Collections.Generic;
using mfe.bll;
using System.Resources;
using System.Threading;
using System.Globalization;

namespace mfe_proj
{
    static class Program
    {
        public static List<Country> CountryCollection;
        public static List<Publisher> PublisherCollection;
        public static List<PublishType> PublishTypeCollection;
        public static List<Item> ItemCollection;
        public static DataTable GenderTable;
        public static ResourceManager Resource;

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            try
            {
                if (Properties.Settings.Default.Language.Length > 0)
                    Thread.CurrentThread.CurrentUICulture = new CultureInfo(Properties.Settings.Default.Language);

                Resource = new ResourceManager("mfe_proj.Strings", System.Reflection.Assembly.GetExecutingAssembly());
                Application.Run(new Forms.MainForm());
            }
            catch (Exception ex)
            {
                //System.Diagnostics.Debug.WriteLine(ex.ToString());
                mfe.lib.Logger.Log(ex);
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                //Forms.ReportBugForm bug = new mfe_proj.Forms.ReportBugForm();
                //bug.ErrorText = ex.ToString();
                //bug.ShowDialog();
            }
        }
    }
}
